#include <stdio.h>
#include <stdlib.h>
#include <time.h>
#include <windows.h>
#include <conio.h>

//声明全局变量
int up = 1, right = 2, down = 3, left = 4;//上下左右
int high = 20, wide = 50;//界定区域
int x, y;//头部坐标
int fx, fy;//果实坐标
int dir;//方向
int len = 0;//初态蛇身长度
int scoretest = 0;//初始分数

int book[50][50] = {0};
int tailx[200] = {0}, taily[200] = {0};

//gotoxy函数
void gotoxy(int x, int y) {
	COORD coord;
	coord.X = x;
	coord.Y = y;
	SetConsoleCursorPosition(GetStdHandle(STD_OUTPUT_HANDLE), coord);
}

//打印水果
void fruit() {
	fx = rand() % (wide - 2) + 1;
	fy = rand() % (high - 2) + 1;
}

//检查游戏进程
int check() {
	if (x < 1 || x >= wide - 1 || y < 1 || y >= high - 1 || book[y][x] == 1) {
		return 1;
	}

	if (x == fx && y == fy) {
		fruit();
		scoretest++;
		len++;
		return 0;
	} else {
		return 0;
	}

	return 0;
}

//打印棋盘
void print() {
	
}

//检测指令
void control() {
	
}

//控制移动
void move() {

}


int main() {
	
	return 0;
}